<div id="main">
    <div id="contents">
        <form method="post" name="filters">
            <fieldset>
                <legend>
                    <label sid="cfgupload.param1" id="title_1"></label>
                </legend>
                <div class="frame_tab_layer">
<span id="loading" style="display:none;">
<label sid="cfgupload.cprogress"></label>
</span>
                    <table class="cmenutitle" width="100%" cellspacing="0" cellpadding="0" border="0">
                        <tbody>
                        <tr id="tr50">
                            <td id="td50" class="frame_tab_center">
                                <input id="filename" type="file" size="35" name="filename">
                            </td>
                        </tr>
                        <tr>
                            <td colspan="2">&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="frame_tab_center" colspan="2">
                                <input class="button" type="button" name="submit" sid="sbutton.upload" id="myUpload"/>
                            </td>
                            <script type="text/javascript">
                                $("#myUpload").val(sbutton.upload);
                                document.getElementById("title_1").innerHTML=cfgupload.param1;
                            </script>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </fieldset>
            <fieldset>
                <legend>
                     <label sid="tools.td4" id="title_2"></label>
                </legend>
                <div class="frame_tab_layer">
                    <table class="cmenutitle" width="100%" cellspacing="0" cellpadding="0" border="0">
                        <tbody>
                        <tr>
                            <td class="frame_tab_center" colspan="2">
                                <input type="hidden" value="1" name="fileid">
                                <input class="button" type="button" onclick="click930();" name="id930" sid="sbutton.down" id="myDown" value="下 载">
                                <script type="text/javascript">
                                    $("#myDown").val(sbutton.down);
                                    document.getElementById("title_2").innerHTML=tools.td4;
                                </script>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
            </fieldset>
        </form>
    </div>
</div>
<br>
<div id="helpContainer">
<div id="help">
<div><h2><img src="images/help_title.png" border="0"><label sid="share.help"></label></h2></div>
<div id="helpBody">
<dl>
   <dt class="term"><label sid="downcfg.info "></label></dt>
    <dd class="definition">
        <label sid="downcfg.sp1"></label><br/><br/>
        <label sid="downcfg.sp2"></label>
    </dd>
</dl>
</div>
</div>
</div>

<script type="text/javascript" src="js/ajaxfileupload.js"></script>
<script type="text/javascript">
    $(document).ready(function(){



        $("[name=submit]").click(function () {
            if($("#filename").val()==""){
                alert(guideInfo.upload);
            }else{
                startUpload();
            }
        });
    });
function click930() {
    $.ajax({
        type: "POST",
        url:  modules["data_download"] + '&id=' + $("input[name=fileid]").val() +  '&tmp=' + Math.random(),
        dataType: "xml",
        error: function (xml) {
            gotologin();
        },
        success: function (xml) {
            var errorcode = $(xml).find('Error').attr('code');
            if (errorcode == '5') {
                gotologin();
            } else {
                $(xml).find('item').each(function () {
                    var downfilename = $(this).attr('value');
                    window.top.location.href = downfilename;
                });
            }
        }
    });
}




function startUpload() {
    $("[name=submit]").attr("disabled", true);
    $("#loading").show();
    $.ajaxFileUpload({
        url: 'upload',
        secureuri: false,
        fileElementId: 'filename',
        dataType: 'xml',
        success: function (data, status) {
            var stat = $(data).find("rsp").attr("stat");
            if (stat == "ok") {
                $("[name=submit]").attr("disabled", false);
                $("#loading").hide();
              //  show_message("success",cfgupload.upok);
              alert(cfgupload.upok);

                loadNewHtml("cfginput.htm");
            } else if (stat == "fail") {
                $("[name=submit]").attr("disabled", false);
                $("#loading").hide();
                var error = $(data).find("error").text();
                //show_message("err",cfgupload.error);
                alert(cfgupload.upfail);
            }
        },
        error: function (data, status, e) {
            $("[name=submit]").attr("disabled", false);
            $("#loading").hide();
           // show_message("err",cfgupload.upfail);
           alert(cfgupload.upfail);
        }
    });
}
</script>
</body>
</html>
